package aecs

import (
	"fmt"

	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

func (c *Client) DeleteInstances(req *ecs.DeleteInstancesRequest) (response *ecs.DeleteInstancesResponse, err error) {
	panic("the delete Action is BatchDeleteInstances")
	client := c.Client

	m := req.GetQueryParams()

	//instancesId, err := json.Marshal([]string{"1226201f-e0a4-4dda-9f09-a05f015272a8"})
	//if err != nil {
	//	return nil, fmt.Errorf("error json.Marshaler %w", err)
	//}
	//m["InstanceId"] = string(instancesId)
	m["InstanceId"] = "1226201f-e0a4-4dda-9f09-a05f015272a8"
	req.Method = "GET"
	req.Port = "8788"
	response, err = client.DeleteInstances(req)
	// client.DoAction(request, response)
	if err != nil {
		return nil, fmt.Errorf("error DeleteInstances instance %w", err)
	}

	return response, nil
}

type nonZeroValueTransformer struct{}

// func (t nonZeroValueTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error {
//     if typ.Kind() == reflect.Int {
//         return func(dst, src reflect.Value) error {
//             if src.Int() != 0 {
//                 dst.SetInt(src.Int())
//             }
//             return nil
//         }
//     }
//     return nil
// }

type update struct {
	a int
	b string
}
